package com.wdz;


import cn.hutool.bloomfilter.bitMap.BitMap;
import cn.hutool.cache.Cache;
import cn.hutool.cache.impl.LFUCache;
import cn.hutool.core.annotation.AnnotationUtil;
import com.wdz.controller.ArticleController;
import org.springframework.web.bind.annotation.PostMapping;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
import java.util.Vector;

public class Test {
    public static void main(String[] args) throws IOException {
        try {
            System.out.println(System.getProperty("user.name"));

            //执行批处理文件
            Process process = Runtime.getRuntime().exec("runas /profile /user:Administrator \"cmd.exe /c sc stop mysql");

            //取得命令结果的输出流
            InputStream fis = process.getInputStream();
            //用一个读输出流类去读
            BufferedReader br = new BufferedReader(new InputStreamReader(fis));
            String line = null;
            //逐行读取输出到控制台
            while ((line = br.readLine()) != null) {
                System.out.println(new String(line.getBytes(StandardCharsets.UTF_8),"GBK"));
            }

        } catch (IOException e) {
            System.out.println(e.getMessage());
            e.printStackTrace();
        }

    }
}
